<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var num;
    var x;
    var fn;
    function init () {
      console.log(88);
    }
    //  预解析：
    //   1.声明提升: 使用var声明的变量会提升JavaScript第一行, function声明的函数提升到var之后
    //   2.执行顺序
    console.log(num);
    num = 8;
    x = 7;

    init();

    fn()
    fn = function () {
      console.log(666);
    }


  </script>
</body>

</html>